﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using Peradigm.Framework.UI.Web;

namespace Liberty.UI
{
    /// <summary>
    /// A ThemedPage customizes web pages by programmatically overriding the ASP.NET
    /// theme property with a value stored in the Session["Theme"].
    /// </summary>
    public class ThemedPage : AbstractLibertyPage
    {
        #region Constants
        public const string SESSION_KEY_THEME = "Theme";
        #endregion

        #region Event Handlers
        protected override void OnPreInit( EventArgs e )
        {
            base.OnPreInit( e );

            string theme = (string)this.Session[SESSION_KEY_THEME];
            if( theme != null && theme != string.Empty )
            {
                Page.Theme = theme;
            }
        }
        #endregion

        #region Methods
        #endregion

        #region Properties
        #endregion

        #region Private Methods
        #endregion

        #region Private Properties
        #endregion

        #region Construction and Finalization
        public ThemedPage()
        {
        }
        #endregion

        #region Data Elements
        #endregion
    }
}